﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WPFSchematics.Definition.Entities;
using System.Windows;
using System.Windows.Media;
using WPFSchematics.Definition.Entities.Collection;


namespace WPFSchematics.Definition.Shapes
{
    /// <summary>
    /// 图元端子。用于图元捕获、拾取、吸附。
    /// </summary>
    public interface IShapeTerminal: IShapeProvider
    {
        /// <summary>
        /// 
        /// </summary>
        HandlerType HandlerType { set; get; }
        /// <summary>
        /// 所属图元。
        /// </summary>
        IShapeFeature ShapeFeature { get; set; }
        /// <summary>
        /// 参考端子集合。
        /// </summary>
        TerminalCollection ReferenceTerminals { get; }
        /// <summary>
        /// 端子样式。
        /// </summary>
        Drawing TerminalDrawing { get; set; }
        /// <summary>
        /// 
        /// </summary>
        event EventHandler<TransformEventArgs> TerminalLocationChanging;
        /// <summary>
        /// 
        /// </summary>
        event EventHandler<TransformEventArgs> TerminalLocationChanged;
    }
     
    /// <summary>
    /// 
    /// </summary>
    public class TransformEventArgs : EventArgs
    {
        public Point OldPoint { get; private set; }

        public Point NewPoint { get; private set; }

        public Point FinalPoint { get; set; }

        public TransformEventArgs(Point newPoint,Point oldPoint)
        {
            OldPoint = oldPoint;
            NewPoint = newPoint;
        }
    }

    /// <summary>
    /// 矩形控制端类型。
    /// </summary>
    public enum HandlerType
    {
        /// <summary>
        /// 
        /// </summary>
        Inner,
        /// <summary>
        /// 复合端。
        /// </summary>
        Outer,
    }
}
